package scjp.preparation.jdbc;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class DBCreate {

	public static void main(String[] args) {
	
		try (Connection connection = DBConnection.connectToDb();
		Statement statement = connection.createStatement()){
		// use CREATE TABLE SQL statement to create table familyGroup
		int result = statement.executeUpdate("CREATE TABLE familyGroup (id int not null auto_increment, nickName varchar(30) not null, primary key(id));");
		System.out.println("Table created successfully");
		System.out.println(result);
		}
		catch (SQLException sqle) {
		sqle.printStackTrace();
		System.exit(-1);
		}
		}
}
